//
//  ThingsListModel.m
//  糗事百科
//
//  Created by lanou on 16/5/28.
//  Copyright © 2016年 奚超明. All rights reserved.
//

#import "ThingsListModel.h"

@implementation ThingsListModel
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"])
    {
        _ID = value;
    }
}
- (instancetype)init{
    self = [super init];
    if (self) {
        _user = [[ThingsListUser alloc] init];
        _votes = [[ThingsVotes alloc] init];
        _image_size = [[ThingsimagesizeModel alloc]init];
    }
    return self;
}
- (void)setValue:(id)value forKey:(NSString *)key{
    if ([key isEqualToString:@"user"])
    {
        [self.user setValuesForKeysWithDictionary:value];
    } else if ([key isEqualToString:@"votes"])
    {
        [self.votes setValuesForKeysWithDictionary:value];
    } else  if ([key isEqualToString:@"image_size"])
    {
        [self.image_size setValuesForKeysWithDictionary:value];
    }else
    {
        [super setValue:value forKey:key];
    }
        
}
@end
